using System;

internal sealed class Employee {
   private String m_Name; // prepended 'm_' to avoid conflict
   private Int32  m_Age;  // prepended 'm_' to avoid conflict

   public String Name {
      get { return(m_Name); }
      set { m_Name = value; } // 'value' identifies new value
   }

   public Int32 Age {
      get { return(m_Age); }
      set {
         if (value <= 0)    // 'value' identifies new value
            throw new ArgumentOutOfRangeException("value", "must be >0");
         m_Age = value;
      }
   }
}


public sealed class Program {
	public static void Main() {
      Employee emp = new Employee();
      emp.Name = "Jeffrey Richter";
      emp.Age = 36;	   // Updates the age
      Console.WriteLine("Employee info: Name = {0}, Age = {1}", emp.Name, emp.Age);

      try {
         emp.Age = -5;	   // Throws an exception
      }
      catch (ArgumentOutOfRangeException e) {
         Console.WriteLine(e);
      }
      Console.WriteLine("Employee info: Name = {0}, Age = {1}", emp.Name, emp.Age);
   }
}
